'\" te
.\" Copyright (c) 2004, Sun Microsystems, Inc. All Rights Reserved.
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
.TH REBOOT 3C "Mar 22, 2004"
.SH NAME
reboot \- reboot system or halt processor
.SH SYNOPSIS
.LP
.nf
#include <sys/reboot.h>

\fBint\fR \fBreboot\fR(\fBint\fR \fIhowto\fR, \fBchar *\fR\fIbootargs\fR);
.fi

.SH DESCRIPTION
.sp
.LP
The \fBreboot()\fR function reboots the system.  The \fIhowto\fR argument
specifies the behavior of the system while rebooting and is a mask constructed
by a bitwise-inclusive-OR of flags from the following list:
.sp
.ne 2
.na
\fB\fBRB_AUTOBOOT\fR\fR
.ad
.RS 15n
The machine is rebooted from the root filesystem on the default boot device.
This is the default behavior. See \fBboot\fR(8) and \fBkernel\fR(8).
.RE

.sp
.ne 2
.na
\fB\fBRB_HALT\fR\fR
.ad
.RS 15n
The processor is simply halted; no reboot takes place. This option should be
used with caution.
.RE

.sp
.ne 2
.na
\fB\fBRB_ASKNAME\fR\fR
.ad
.RS 15n
Interpreted by the bootstrap program and kernel, causing the user to be asked
for pathnames during the bootstrap.
.RE

.sp
.ne 2
.na
\fB\fBRB_DUMP\fR\fR
.ad
.RS 15n
The system is forced to panic immediately without any further processing and a
crash dump is written to the dump device (see \fBdumpadm\fR(8)) before
rebooting.
.RE

.sp
.LP
Any other \fIhowto\fR argument causes the kernel file to boot.
.sp
.LP
The interpretation of the \fIbootargs\fR argument is platform-dependent.
.SH RETURN VALUES
.sp
.LP
Upon successful completion, \fBreboot()\fR never returns.  Otherwise,
\fB\(mi1\fR is returned and \fBerrno\fR is set to indicate the error.
.SH ERRORS
.sp
.LP
The \fBreboot()\fR function will fail if:
.sp
.ne 2
.na
\fB\fBEPERM\fR\fR
.ad
.RS 9n
The {\fBPRIV_SYS_CONFIG\fR} privilege is not asserted in the effective set of
the calling process.
.RE

.SH SEE ALSO
.sp
.LP
.BR uadmin (2),
.BR Intro (8),
.BR boot (8),
.BR dumpadm (8),
.BR halt (8),
.BR init (8),
.BR kernel (8),
.BR reboot (8)
